﻿<Window x:Class="MercuryFE.Main"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:MercuryFE"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
    Title="Control Panel Editor" Height="600" Width="810" Icon="/ControlPanelEditor;component/arcade.ico">
    <Window.Resources>
        <!--<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources\GlassButton.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <ControlTemplate x:Key="template1" >
                <Ellipse Width="60" Height="60" Fill="Black"/>
            </ControlTemplate>
        </ResourceDictionary>-->
        <ObjectDataProvider MethodName="GetType" ObjectType="{x:Type sys:Type}" x:Key="colorsTypeOdp">
            <ObjectDataProvider.MethodParameters>
                <sys:String>System.Windows.Media.Colors, PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</sys:String>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
        <ObjectDataProvider ObjectInstance="{StaticResource colorsTypeOdp}" MethodName="GetProperties" x:Key="colorPropertiesOdp">
        </ObjectDataProvider>

        <ObjectDataProvider x:Key="dataFromLabelPosEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="local:LabelPositionType"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

    </Window.Resources>

    <DockPanel LastChildFill="True">
         <Border Name="border1" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" DockPanel.Dock="Left" Width="150" >
            <StackPanel HorizontalAlignment="Stretch"  Name="spObjects" Margin="5">
                <Border x:Name="brdItems" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" Width="110" Margin="5" Padding="5">
                    <StackPanel Orientation="Vertical">
                        <Label FontWeight="Bold">Items</Label>
                        <Button  x:Name="btnAddButton" Click="btnAddButton_Click" Style="{StaticResource myButtonImage}" Background="Red" />
                        <Button  x:Name="btnAddJoystick" Click="btnAddJoystick_Click" Style="{StaticResource myJoystickImage}" Background="Red" />
                        <Button  x:Name="btnAddTrackball" Click="btnAddTrackball_Click" Style="{StaticResource myTrackballImage}" Background="Red" />
                    </StackPanel>
                </Border>


                <Border x:Name="brdLayout" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" Width="110" Margin="5" Padding="5">
                    
                    <StackPanel Orientation="Vertical">
                        <Label FontWeight="Bold">Layout</Label>
                        <Button x:Name="btnLoadLayout" Click="btnLoadLayout_Click">Load</Button>
                        <Button x:Name="btnSaveLayout" Click="btnSaveLayout_Click">Save</Button>
                        <Button x:Name="btnAssignInputs" Click="btnAssignInputs_Click">Assign Inputs</Button>
                    </StackPanel>
                </Border>
                


                <Border x:Name="brdAssignment" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" Width="110" Margin="5" Padding="5" Visibility="Collapsed">

                    <StackPanel Orientation="Vertical">
                        <Label FontWeight="Bold">Assignment</Label>
                        <ComboBox x:Name="cmbAssignment" SelectionChanged="cmbAssignment_SelectionChanged"></ComboBox>
                        <Button x:Name="btnNewAssignment" Click="btnNewAssignment_Click">Create</Button>
                        <Button x:Name="btnSaveAssignment" Click="btnSaveAssignment_Click" IsEnabled="False">Save</Button>
                        <Button x:Name="btnDeleteAssignment" Click="btnDeleteAssignment_Click"  IsEnabled="False">Delete</Button>
                        <Button x:Name="btnExportMameConfig" Click="btnExportMameConfig_Click"  IsEnabled="False">Mame Config</Button>
                    </StackPanel>
                </Border>

                <Border x:Name="brdEditType" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" Width="110" Margin="5" Padding="5">
                    <StackPanel Orientation="Vertical">
                        <Label FontWeight="Bold">Edit Type</Label>
                        <RadioButton x:Name="radEditTypeLayout" GroupName="radEditType" Checked="radEditTypeLayout_Checked" IsChecked="True">Layout</RadioButton>
                        <RadioButton x:Name="radEditTypeAssignment" GroupName="radEditType" Checked="radEditTypeAssignment_Checked">Assignment</RadioButton>
                    </StackPanel>
                </Border>

            </StackPanel>
        </Border>

        <Border Name="border3" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" DockPanel.Dock="Right" Width="150">
            <StackPanel Orientation="Vertical">
                <Border x:Name="brdLayoutProperties" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" Width="135" Margin="5" Padding="5" Visibility="Collapsed">

                    <StackPanel Orientation="Vertical" >
                        <Label Height="23" Name="lblColorSelector" Width="120" FontWeight="Bold" HorizontalAlignment="Left">Color:</Label>
                        <ComboBox x:Name="colorSelector" SelectionChanged="colorSelector_SelectionChanged" />

                        <Label Height="23" Name="lblLabelPosSelector" Width="120" FontWeight="Bold" HorizontalAlignment="Left">Label Postion:</Label>
                        <ComboBox x:Name="labelPosSelector" ItemsSource="{Binding Source={StaticResource dataFromLabelPosEnum}}"  SelectionChanged="labelPosSelector_SelectionChanged"/>
                        
                        <Label Height="23" Name="lblAssignedKey" Width="120" FontWeight="Bold" HorizontalAlignment="Left">Assigned Key(s):</Label>
                        <TextBlock Name="tbAssignedKey" Width="120" HorizontalAlignment="Left"/>
                    </StackPanel>
                </Border>

                <Border x:Name="brdAssignmentProperties" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" Width="135" Margin="5" Padding="5" Visibility="Collapsed">

                    <StackPanel Orientation="Vertical" >
                        <StackPanel Orientation="Horizontal">
                            <RadioButton x:Name="radAssignmentSimple" GroupName="AssignmentType" Checked="radAssignmentSimple_Checked" IsChecked="True">Simple</RadioButton>
                            <RadioButton x:Name="radAssignmentUI" GroupName="AssignmentType" Checked="radAssignmentUI_Checked" >UI</RadioButton>
                            <RadioButton x:Name="radAssignmentCustom" GroupName="AssignmentType" Checked="radAssignmentCustom_Checked" >Custom</RadioButton>
                        </StackPanel>
                        
                        <StackPanel x:Name="spAssignments"></StackPanel>
                    </StackPanel>
                </Border>
            </StackPanel>
        </Border>

        <Border Name="border2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="Black" >
            <Canvas Name="XXX" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                <Canvas Name="csMain" Background="LightGray"  Width="300" Height="300" HorizontalAlignment="Left" VerticalAlignment="Top" />
            </Canvas>
                
            <!--HorizontalAlignment="Stretch" VerticalAlignment="Stretch"-->
        </Border>
  
    </DockPanel>

</Window>
